home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / arexx / toasterpaint / blurvignette.rexx next >
OS/2 REXX Batch file  |  1995-12-27  |  4KB  |  127 lines

  1. /* BlurVignette.rexx V2.0 -- Blur Pic Or Clip Edges. */
  2. /* By Bob Caron © 1995 NewTek Inc.                   */
  3. /* Originaly by Arnie Cachelin                       */
  4.  
  5. parse arg InClipName","OutClipName","StartField","EndField
  6.  
  7. Address "DigiPaint"
  8. options results
  9.  
  10. IFFBaseName=OutClipName
  11.  
  12. call remlib("rexxsupport.library")
  13. addlib('rexxsupport.library',0,-30,34)
  14.  
  15. screen=0
  16. if inclipname="" then screen=1
  17. if screen=1 then do
  18.    startfield=1
  19.    endfield=1
  20.    end
  21.  
  22. /* Reset Paint */
  23. 'Pmcl'
  24. 'Pot0' 0
  25. 'Pot1' 0
  26. 'Poth' $8000
  27. 'Potv' $8000
  28. 'Spoh' $8000
  29. 'Spov'
  30. /* End Of Reset*/
  31.  
  32. PageWide=752
  33. PageHigh=480
  34. dots=0
  35. XWin = 100
  36. YWin = 40
  37. Clear = d2c(12)
  38. nv = ''
  39. cr = '0a'x
  40. call getfontsize
  41.  
  42. wid = width*48
  43. hei = theight+height*10
  44.  
  45. if screen=0 then do
  46.    if ~open('Window','RAW:'XWin'/'YWin'/'wid'/'hei'/BlurVignette Script V2.0 - CTRL-C to Abort/NOSIZE/SCREEN 'ps,'W') then do
  47.        exit
  48.    end
  49. end
  50.  
  51. do Frame = StartField to (StartField+(EndField-StartField)/2)
  52.   if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
  53.   if screen=0 then 'Gnfd'          /* Get the next field to process          */
  54.   call filter()                    /* Do The filter Thing...                 */
  55.   if screen=0 then 'Apfc'          /* Apeend the field to clip               */
  56.   if screen=0 then 'Gnfd'          /* Get the next field to process          */
  57.   if screen=0 then call filter()   /* If this is a flyer clip do other field */
  58.   if screen=0 then 'Apfc'          /* Apeend the field to clip               */
  59.   if screen=1 then 'Shco'          /* Render To Buffer (if this is screen processing)*/
  60.   end
  61. if screen=0 then 'Iclp'            /* Add an flyer icon to this clip */
  62. exit
  63.  
  64.  
  65. filter:  /* Do a filter */
  66.  
  67. 'Hvof'          /* Set to radial gradient off */
  68. if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
  69. 'Hvar'          /* Toggle radial gradient blend */
  70. 'Potv' $8000    /* Set hotspot center */
  71. 'Poth' $8000    /* Set hotspot  center */
  72. if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
  73. 'Minc'          /* Set Center transparency to 0% */
  74. 'Maxe'          /* Set Edge transparency to 100% */
  75. 'Blu2'          /* Heavy Blur mode */
  76. if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
  77. 'Whsc'          /* Fill Whole Screen */
  78. 'Blu2'          /* Heavy Blur mode */
  79. 'Whsc'          /* Fill Whole Screen */
  80.  
  81. return
  82.  
  83.  
  84. OpenWindow:
  85. parse arg InclipName,OutClipName,currentframe,EndFrame,Frame
  86.   pdots="...."
  87.   dots=dots+1
  88.   if dots>4 then dots=1
  89.   call writech('Window',Clear||nv||cr)
  90.   call writech('Window','Current Source Clip ['InClipName']'cr)
  91.   call writech('Window','  Current Dest Clip ['OutClipName']'cr)
  92.   call writech('Window',''cr)
  93.   call writech('Window','Current Frame: 'Frame/2''cr)
  94.   call writech('Window','    End Frame:'EndFrame/2''cr)
  95.   call writech('Window',''cr)
  96.   call writech('Window','Processing'right(pdots,dots)||cr)
  97.  
  98. return
  99.  
  100.  
  101. getfontsize:
  102.  
  103. if open('font','env:sys/font.prefs','R') then do
  104.    font = readch('font',word(statef('env:sys/font.prefs'),2))
  105.    call close('font')
  106.    font = substr(font,index(font,'FONT')+4)
  107.    font = substr(font,index(font,'FONT')+4)
  108.    height = c2d(substr(font,29,2))
  109.    tfont = substr(font,index(font,'FONT')+4)
  110.    theight = c2d(substr(tfont,29,2))
  111.    font = substr(font,33)
  112.    font = left(font,index(font,d2c(0))-1-5)
  113.    if open('font','FONTS:'font'/'height,'R') then do
  114.       width = c2d(right(readch('font',116),2))
  115.       call close('font')
  116.   end
  117.   else if height=9 then width = 10
  118.                    else width = 8
  119. end
  120.   else do
  121.   theight = 8
  122.   height = 8
  123.   width = 8
  124. end
  125.  
  126. return
  127.